{block content}
<div class="block">
	<div class="block_body">
					  {snippet calendar}
		<div style="float:left"><a n:href="minusMonth!" class="ajax">&lt; Předchozí měsíc</a></div>
		<div style="float:right"><a n:href="plusMonth!" class="ajax">Následující měsíc &gt;</a></div>
		<div style="text-align: center;">{$month->monthNumber|czMonth}</div>
		<div style="clear:both"></div>
		<table class="calendar">
						  {foreach $month->weeks as $week}
			<tr>
				<td class="calendar_week">{$week->weekNumber}</td>
							{foreach $week->days as $day}
				<td class="calendar_day{if $day->isWeekend} calendar_free{/if}">
					<div class="calendar_day_name">{$day->date|date:D}</div>
					<div class="calendar_day_date">{$day->date|date:'j.n'}</div>
					<div class="clear"></div>
					<div class="events">
									  {ifset $day->events['projects']}
									  {foreach $day->events['projects'] as $project}
						<div class="event">
							<a n:href=":Project:overview, $project[id]">{$project[name]}</a>
						</div>
									  {/foreach}
									  {/ifset}
									  {ifset $day->events['milestones']}
									  {foreach $day->events['milestones'] as $milestone}
						<div class="event">
							<a n:href=":Project:milestones, $milestone->project[id]">{$milestone[name]}</a>
						</div>
									  {/foreach}
									  {/ifset}
									  {ifset $day->events['tasks']}
									  {foreach $day->events[tasks] as $task}
						<div class="event">
							<div class="event_priority priority{$task->task_priority[priority]}"></div>
							<a n:href=":Task:task, $task[id]">{$task[name]}</a>
						</div>
									  {/foreach}
									  {/ifset}
					</div>
				</td>
							{/foreach}
			</tr>
						  {/foreach}

		</table>
					  {/snippet}
	</div>
</div>
{/block}
{block head}
<style>
.calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 15px;
}

.calendar_day {
    width: 14%;
    background-color: #212426;
    border: 1px solid #9faab3;
    height: 110px;
    vertical-align: top;
}

.calendar_day.calendar_free {
    background-color: #4b2323;
}

.calendar_week {
    background-color: #40474d;
    border: 1px solid #9faab3;
    text-align: center;
    vertical-align: middle;
}

.calendar_day_name {
    width: 45%;
    float:left;
    margin-left: 5%;
    margin-top: 5px;
}
.calendar_day_date {
    width: 45%;
    float: right;
    margin-right: 5%;
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: right;
}
.events .event .event_priority {
    display: inline-block;
    height: 5px;
    width: 5px;
    border: 1px solid black;
}

.events .event {
    font-size: 10px;
    margin-bottom: 2px;
}
</style>
{/block}